package com.xianjindai.facade.borrow.service;



import java.math.BigDecimal;

import com.xianjindai.commons.dto.ResultDto;
import com.xianjindai.commons.product.model.Product;
import com.xianjindai.facade.borrow.vo.BorrowMsgVO;
import com.xianjindai.facade.borrow.vo.MemberDataVo;
import com.xianjindai.facade.member.vo.MemberMsgVO;



/**
 * 
* @ClassName: IBorrowService
* @Description: 用户借款信息类
* @author liyb
* @date 2017年4月6日 上午10:52:00
*
 */
public interface IBorrowService {

	/**
	 * 获取所有的用户借款信息
	 * @param startRow
	 * @return
	 * @throws Exception
	 */
	public ResultDto BorrowList(Long memberId , Integer startRow) throws Exception;
	
	/**
	 * 取消借款
	 * @param borrowId
	 * @param memberId
	 * @return
	 * @throws Exception
	 */
	public ResultDto cancelBorrow(Long borrowId , Long memberId) throws Exception;
	
	/**
	 * 查看借款合同
	 * @param contractId
	 * @return
	 * @throws Exception
	 */
	public ResultDto getOwnBorrowContracts(Long borrowId , Long memberId) throws Exception;
	/**
	 * 判断用户是否存在未完成的借款
	 * @param memberId 用户Id
	 * @return
	 */
	public boolean hasUncompletedBorrow(Long memberId) throws Exception;
	/**
	 * 保存借款
	 * @param memberId
	 * @param borrowMoney
	 * @param duration
	 * @param durationType
	 * @return
	 */
	public ResultDto saveBorrow(Long memberId, BigDecimal borrowMoney,
			Integer duration, Product xjdProduct) throws Exception;
	/**
	 * 查看借款人信息
	 * @param memberId
	 * @param borrowId
	 * @return
	 */
	public ResultDto selectMemberData(Long memberId) throws Exception;
	
	public ResultDto getBorrowCenter(Long memberId) throws Exception;
	
	/**
	 * 查看申请借款人信息
	 * @param memberId
	 * @param borrowId
	 * @return
	 * @throws Exception
	 */
	public ResultDto getBorrowBaseMessage(Long memberId , Long borrowId) throws Exception;
	
	/**
	 * 获取用户距离还款日天数
	 * @param memberId 用户id
	 * @param borrowId 借款id
	 * @return
	 * @throws Exception
	 */
	public ResultDto getBorrowRepaymentDate(Long memberId, Long borrowId) throws Exception;
	
	public ResultDto saveMemberData(Long memberId , Long borrowId, MemberDataVo vo) throws Exception;
	
	public ResultDto getCurrentRepaymentMoney(Long memberId) throws Exception;
	/**
	 * 保存借款
	 */
	public ResultDto saveBorrowMsg(Long memberId, MemberMsgVO memberMsgVO,
			BorrowMsgVO borrowMsgVO) throws Exception;
	/**
	 * 获取人脸识别次数
	 * @param memberId 用户Id
	 * @param operateTYpe 操作类型
	 * @return
	 */
	public int getFaceLogCount(Long memberId, String operateTYpe);
	
}
